package com.haust.controller;

import com.haust.commons.pojo.HaustResult;
import com.haust.service.FileUpLoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@CrossOrigin
public class FileUpLoadController {

    @Autowired
    private FileUpLoadService fileUpLoadService;

    @PostMapping("/file/upload")
    public HaustResult upload(MultipartFile file) {
        return fileUpLoadService.upload(file);
    }
}
